/*
 * =====================================================================================
 *
 *       Filename:  sa.h
 *
 *    Description:  Header file for simulated annealing algorithm
 *
 *        Version:  1.0
 *        Created:  06/07/12 13:32:22
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Moos Hueting (mh), mooshueting@gmail.com
 *   Organization:  
 *
 * =====================================================================================
 */
#ifndef _SA
#define _SA

#include <cv.h>
#include <highgui.h>
#include <ml.h>
#include "constraintSet.h"
#include "multinorm.h"

using namespace cv;

class SA {
    Mat currentSolution;
    Mat currentIso;
    double temperature;
    ConstraintSet constraints;
    MultiNorm MN;
public:
    SA();
    SA(const char*);
    SA(Mat, double);

    void step();
    void nsteps(int, int);
    void lowerTemperature();

    double energy() { return energy(currentIso); }
    double energy(Mat);

    Mat getSolution() { return currentSolution; }
    Mat getIso() { return currentIso; }

    double getTemperature() { return temperature; }

    Mat mutate();
};

#endif
